import 'dart:convert';

import 'package:learning/generated/json/base/json_field.dart';
import 'package:learning/generated/json/category_entity.g.dart';

export 'package:learning/generated/json/category_entity.g.dart';

@JsonSerializable()
class CategoryEntity {
  late bool enable;
  late String name;
  late String content;
  late String icon;
  late int id;
  late int type;

  CategoryEntity();

  factory CategoryEntity.fromJson(Map<String, dynamic> json) =>
      $CategoryEntityFromJson(json);

  Map<String, dynamic> toJson() => $CategoryEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
